Requires Scripting PRO
The FontPicker namespace provides methods for selecting fonts from the system’s available font list.
It opens the system font picker UI, allowing the user to choose a font, and returns the PostScript name of the selected font.
In scenarios such as custom text editors, UI design, or typography styling, users may need to select a font dynamically.
FontPicker offers a simple asynchronous interface to display the system’s font picker and obtain the selected font name.
pickFont(): Promise<string | null>Opens the system font picker interface and lets the user select a font. Returns a Promise that resolves when the user either selects a font or cancels the picker.
Return Value:
string — The PostScript name of the selected font (e.g., "Helvetica-Bold", "KaitiSC-Regular").null — Returned if the user cancels the picker.Example output:
null; your code should handle this case gracefully.| Method | Return Type | Description |
|---|---|---|
pickFont() |
Promise<string | null> |
Opens the system font picker and returns the PostScript name of the selected font or null if canceled |